﻿<UserControl x:Class="ImageTagEditor.ImageTagView"
			 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
			 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
			 xmlns:sys="clr-namespace:System;assembly=mscorlib"
			 xmlns:custom="clr-namespace:ImageTagEditor"
			 xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
			 Background="Transparent"
			 x:Name="view">
	
	<UserControl.Resources>
		<sys:Double x:Key="labelWidth">105</sys:Double>
		<VerticalAlignment x:Key="labelVerticalAlignment">Center</VerticalAlignment>
		<HorizontalAlignment x:Key="labelHorizontalAlignment">Left</HorizontalAlignment>
		
		
		
		<!-- Watermark Resources -->
		<sys:String x:Key="watermarkString">Information Not Present</sys:String>
		
		<Storyboard x:Key="whenGotFocus" >
			<DoubleAnimation Duration="0:0:0.4" 
							 To="0.30" 
							 Storyboard.TargetProperty="Opacity" 
							 Storyboard.TargetName="Watermark"/>
		</Storyboard>


		<Storyboard x:Key="whenTextIsEmpty" >
			<DoubleAnimation Duration="0:0:0.4" 
							 Storyboard.TargetProperty="Opacity" 
							 Storyboard.TargetName="Watermark"/>
		</Storyboard>

		<Storyboard x:Key="whenHasText" >
			<DoubleAnimation Duration="0:0:0.4" 
							 To="0" 
							 Storyboard.TargetProperty="Opacity"  
							 Storyboard.TargetName="Watermark"/>
		</Storyboard>

		<Style x:Key="watermarkTextBox" 
			   TargetType="{x:Type TextBox}" 
			   BasedOn="{StaticResource {x:Type TextBox}}">
			<Setter Property="OverridesDefaultStyle" Value="false"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type TextBox}">
						<Microsoft_Windows_Themes:ListBoxChrome SnapsToDevicePixels="true" 
																x:Name="Bd" 
																Background="{TemplateBinding Background}" 
																BorderBrush="{TemplateBinding BorderBrush}" 
																BorderThickness="{TemplateBinding BorderThickness}" 
																RenderFocused="{TemplateBinding IsKeyboardFocusWithin}" 
																RenderMouseOver="{TemplateBinding IsMouseOver}">
							<Grid>

								<Decorator x:Name="PART_ContentHost"  
										   VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
										   Margin="{TemplateBinding Margin}"/>
								<!-- The watermark -->
								<ContentControl Content="{TemplateBinding Tag}" 
												x:Name="Watermark"
												IsHitTestVisible="False"
												Opacity="0.30" 
												Margin="3,0,0,0" 
												Focusable="False"/>
							</Grid>
						</Microsoft_Windows_Themes:ListBoxChrome>

						<ControlTemplate.Triggers>

							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
								<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
							</Trigger>

							<!-- Here is our watermark behavior -->
							<Trigger Property="IsFocused" Value="true">
								<Trigger.EnterActions>
									<BeginStoryboard Storyboard="{StaticResource whenGotFocus}"/>
								</Trigger.EnterActions>
							</Trigger>

							<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Text}" 
										 Value="">
								<DataTrigger.EnterActions>
									<BeginStoryboard Storyboard="{StaticResource whenTextIsEmpty}"/>
								</DataTrigger.EnterActions>
								<DataTrigger.ExitActions>
									<BeginStoryboard Storyboard="{StaticResource whenHasText}"/>
								</DataTrigger.ExitActions>
							</DataTrigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<!-- End of Watermark Resources -->
		
	</UserControl.Resources>
	
    <Grid>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="*" />
			<ColumnDefinition Width="*" />
		</Grid.ColumnDefinitions>
		
		<Grid Grid.Column="0"
			  Background="Transparent">
			<Grid.RowDefinitions>
				<RowDefinition Height="auto" />
				<RowDefinition Height="*" />
			</Grid.RowDefinitions>
						
			<Image x:Name="image" 
				   Grid.Row="1" />
		</Grid>
		
		<Border Grid.Column="1" 
				BorderBrush="Blue" 
				BorderThickness="1,1,0,1"  
				CornerRadius="2" 
				Background="White">
			<ScrollViewer VerticalScrollBarVisibility="Auto">
				<StackPanel>
					<Expander x:Name="generalExpander" 
							  Header="General"
							  BorderBrush="Blue"
							  BorderThickness="0,0,0,1" 
							  Background="LightBlue"
							  IsExpanded="{Binding ElementName=view, Path=IsGeneralExpanded}" >
						<Grid Background="White" 
							  Margin="2,3,2,2">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="auto" />
								<ColumnDefinition Width="*" />
							</Grid.ColumnDefinitions>
							<Grid.RowDefinitions>
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
							</Grid.RowDefinitions>
								
							<!-- File Path -->
							<TextBlock Grid.Row="0"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}">
								File Location						
							</TextBlock>
							<TextBox x:Name="filePathTextBox"
									 IsReadOnly="True" 
									 Grid.Row="0"
									 Grid.Column="1" >
								<TextBox.ToolTip>
									<custom:PowerToolTip Header="FilePath"
														 Error=""
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<TextBlock TextWrapping="WrapWithOverflow" >
												The current location of the image in the file system.
											</TextBlock>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</TextBox.ToolTip>
							</TextBox>
								
							<!-- Pixel Height -->
							<TextBlock Grid.Row="1"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}">
								Pixels Tall
							</TextBlock>
							<TextBox Grid.Row="1"
									 Grid.Column="1"
									 x:Name="pixelHeightTextBox"
									 IsReadOnly="True">
								<TextBox.ToolTip>
									<custom:PowerToolTip Header="Pixels Tall"
														 Error=""
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<TextBlock TextWrapping="WrapWithOverflow" >
												The number of rows of pixels that comprise this image.
											</TextBlock>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</TextBox.ToolTip>
							</TextBox>
								
							<!-- Pixel Width -->
							<TextBlock Grid.Row="2"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}">
								Pixels Wide
							</TextBlock>
							<TextBox Grid.Row="2"
									 Grid.Column="1"
									 x:Name="pixelWidthTextBox"
									 IsReadOnly="True">
								<TextBox.ToolTip>
									<custom:PowerToolTip Header="Pixels Wide"
														 Error=""
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<TextBlock TextWrapping="WrapWithOverflow" >
												The number of columns of pixels that comprise this image.
											</TextBlock>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</TextBox.ToolTip>
							</TextBox>
							
							<!-- X Resolution -->
							<TextBlock Grid.Row="3"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}">
								X Resolution
							</TextBlock>
							<custom:RationalTextBox x:Name="xResolutionTextBox"
													Grid.Row="3"
													Grid.Column="1"
													IsSigned="False"
													IsReadOnly="True"
													Style="{DynamicResource watermarkTextBox}" 
													Tag="{StaticResource watermarkString}">
								<custom:RationalTextBox.ToolTip>
									<custom:PowerToolTip Header="X Resolution"
														 Error=""
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<TextBlock TextWrapping="WrapWithOverflow" >
												The number of pixels per unit in the image width direction.
											</TextBlock>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</custom:RationalTextBox.ToolTip>
							</custom:RationalTextBox>
							
							<!-- Y Resolution -->
							<TextBlock Grid.Row="4"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}">
								Y Resolution
							</TextBlock>
							<custom:RationalTextBox x:Name="yResolutionTextBox"
													Grid.Row="4"
													Grid.Column="1"
													IsSigned="False"
													IsReadOnly="True"
													Style="{DynamicResource watermarkTextBox}" 
													Tag="{StaticResource watermarkString}">
								<custom:RationalTextBox.ToolTip>
									<custom:PowerToolTip Header="Y Resolution"
														 Error=""
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<TextBlock TextWrapping="WrapWithOverflow" >
												The number of pixels per unit in the image's height direction.
											</TextBlock>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</custom:RationalTextBox.ToolTip>
							</custom:RationalTextBox>
							
							<!-- Resolution Unit -->
							<TextBlock Grid.Row="5"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}">
								Resolution Unit
							</TextBlock>
							<TextBox x:Name="resolutionUnitTextBox"
									 Grid.Row="5"
									 Grid.Column="1"
									 IsReadOnly="True" 
									 Style="{DynamicResource watermarkTextBox}" 
									 Tag="{StaticResource watermarkString}">
								<TextBox.ToolTip>
									<custom:PowerToolTip Header="Resolution Unit"
														 Error=""
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<TextBlock TextWrapping="WrapWithOverflow" >
												The unit for measuring X Resolution and Y Resolution. The same unit is used for both XResolution and YResolution.
												Possible values are inches and centimeters.
											</TextBlock>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</TextBox.ToolTip>
							</TextBox>
							
							<!-- Unit Height -->
							<TextBlock Grid.Row="6"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}">
								Height
							</TextBlock>
							<TextBox x:Name="unitHeightTextBox"
									 Grid.Row="6"
									 Grid.Column="1"
									 IsReadOnly="True" 
									 Style="{DynamicResource watermarkTextBox}" 
									 Tag="{StaticResource watermarkString}">
								<TextBox.ToolTip>
									<custom:PowerToolTip Header="Height"
														 Error=""
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<TextBlock TextWrapping="WrapWithOverflow" >
												The height of the image given in the resolution unit.
											</TextBlock>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</TextBox.ToolTip>
							</TextBox>
							
							<!-- Unit Width -->
							<TextBlock Grid.Row="7"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}">
								Width
							</TextBlock>
							<TextBox x:Name="unitWidthTextBox"
									 Grid.Row="7"
									 Grid.Column="1"
									 IsReadOnly="True" 
									 Style="{DynamicResource watermarkTextBox}" 
									 Tag="{StaticResource watermarkString}">
								<TextBox.ToolTip>
									<custom:PowerToolTip Header="Width"
														 Error=""
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<TextBlock TextWrapping="WrapWithOverflow" >
												The width of the image given in the resolution unit.
											</TextBlock>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</TextBox.ToolTip>
							</TextBox>
						</Grid>
						
							
					</Expander>
					<Expander x:Name="descriptionExpander"
							  Header="Description"
							  BorderBrush="Blue"
							  BorderThickness="0,0,0,1" 
							  Background="LightBlue"
							  IsExpanded="{Binding ElementName=view, Path=IsDescriptionExpanded}" >
						<Grid Background="White" 
							  Margin="2,3,2,2">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="auto" />
								<ColumnDefinition Width="*" />
							</Grid.ColumnDefinitions>
							<Grid.RowDefinitions>
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
							</Grid.RowDefinitions>
							
							<!-- Image Description -->
							<TextBlock Grid.Row="0"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}">
								Image Description
							</TextBlock>
							<TextBox x:Name="imageDescriptionTextBox"
									 Grid.Row="0"
									 Grid.Column="1"
									 AcceptsReturn="True"
									 Style="{DynamicResource watermarkTextBox}" 
									 Tag="{StaticResource watermarkString}">
								<TextBox.ToolTip>
									<custom:PowerToolTip Header="Image Description"
														 Error=""
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<TextBlock TextWrapping="WrapWithOverflow" >
												A description of the image.
											</TextBlock>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</TextBox.ToolTip>
							</TextBox>
							
							<!-- Make -->
							<TextBlock Grid.Row="1"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}">
								Make
							</TextBlock>
							<TextBox x:Name="makeTextBox"
									 Grid.Row="1"
									 Grid.Column="1"
									 Style="{DynamicResource watermarkTextBox}" 
									 Tag="{StaticResource watermarkString}">
								<TextBox.ToolTip>
									<custom:PowerToolTip Header="Make"
														 Error=""
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<TextBlock TextWrapping="WrapWithOverflow" >
												The manufacturer of the recording equipment. This is the manufacturer of the DSC, scanner, video digitizer or other equipment that generated the image.
											</TextBlock>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</TextBox.ToolTip>
							</TextBox>
							
							<!-- Model -->
							<TextBlock Grid.Row="2"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}">
								Model
							</TextBlock>
							<TextBox x:Name="modelTextBox"
									 Grid.Row="2"
									 Grid.Column="1"
									 Style="{DynamicResource watermarkTextBox}" 
									 Tag="{StaticResource watermarkString}">
								<TextBox.ToolTip>
									<custom:PowerToolTip Header="Model"
														 Error=""
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<TextBlock TextWrapping="WrapWithOverflow" >
												The model name or model number of the equipment. This is the model name of number of the DSC, scanner, video digitizer or other equipment that generated the image.
											</TextBlock>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</TextBox.ToolTip>
							</TextBox>
							
							<!-- Software -->
							<TextBlock Grid.Row="3"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}">
								Software
							</TextBlock>
							<TextBox x:Name="softwareTextBox"
									 Grid.Row="3"
									 Grid.Column="1"
									 Style="{DynamicResource watermarkTextBox}" 
									 Tag="{StaticResource watermarkString}">
								<TextBox.ToolTip>
									<custom:PowerToolTip Header="Software"
														 Error=""
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<TextBlock TextWrapping="WrapWithOverflow" >
												The name and version of the software or firmware of the camera or image input device used to generate the image.
											</TextBlock>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</TextBox.ToolTip>
							</TextBox>
							
							<!-- Artist -->
							<TextBlock Grid.Row="4"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}">
								Artist
							</TextBlock>
							<TextBox x:Name="artistTextBox"
									 Grid.Row="4"
									 Grid.Column="1"
									 Style="{DynamicResource watermarkTextBox}" 
									 Tag="{StaticResource watermarkString}">
								<TextBox.ToolTip>
									<custom:PowerToolTip Header="Artist"
														 Error=""
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<TextBlock TextWrapping="WrapWithOverflow" >
												The name of the camera owner, photographer or image creator.
											</TextBlock>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</TextBox.ToolTip>
							</TextBox>
							
							<!-- Copyright -->
							<TextBlock Grid.Row="5"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}">
								Copyright
							</TextBlock>
							<TextBox x:Name="copyrightTextBox"
									 Grid.Row="5"
									 Grid.Column="1" 
									 AcceptsReturn="True"
									 Style="{DynamicResource watermarkTextBox}" 
									 Tag="{StaticResource watermarkString}">
								<TextBox.ToolTip>
									<custom:PowerToolTip Header="Copyright"
														 Error=""
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<TextBlock TextWrapping="WrapWithOverflow" >
												The copyright notice of the person or organization claiming rights to the image.
											</TextBlock>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</TextBox.ToolTip>
							</TextBox>
							
							<!-- User Comment -->
							<TextBlock Grid.Row="6"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}"
									   Visibility="{DynamicResource userCommentVisibility}">
								User Comment
							</TextBlock>
							<TextBox x:Name="userCommentTextBox"
									 Grid.Row="6"
									 Grid.Column="1"
									 AcceptsReturn="True"
									 Style="{DynamicResource watermarkTextBox}" 
									 Tag="{StaticResource watermarkString}"
									 Visibility="{DynamicResource userCommentVisibility}">
								<TextBox.ToolTip>
									<custom:PowerToolTip Header="User Comment"
														 Error=""
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<TextBlock TextWrapping="WrapWithOverflow" >
												Any keywords or comments on the image besides those in Image Description.
											</TextBlock>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</TextBox.ToolTip>
							</TextBox>
							
							<!-- Maker Note -->
							<TextBlock Grid.Row="7"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}"
									   Visibility="{DynamicResource makerNoteVisibility}">
								Maker Note
							</TextBlock>
							<TextBox x:Name="makerNoteTextBox"
									 Grid.Row="7"
									 Grid.Column="1"
									 AcceptsReturn="True"
									 Style="{DynamicResource watermarkTextBox}" 
									 Tag="{StaticResource watermarkString}"
									 Visibility="{DynamicResource makerNoteVisibility}">
								<TextBox.ToolTip>
									<custom:PowerToolTip Header="Maker Note"
														 Error=""
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<TextBlock TextWrapping="WrapWithOverflow" >
												A note from the manufacturer of the image.
											</TextBlock>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</TextBox.ToolTip>
							</TextBox>
						</Grid>
					</Expander>

					<Expander x:Name="dateTimeExpander"
						      Header="DateTime"
						      BorderBrush="Blue"
						      BorderThickness="0,0,0,1" 
						      Background="LightBlue"
							  IsExpanded="{Binding ElementName=view, Path=IsDateTimeExpanded}">
						<Grid Background="White" 
						  Margin="2,3,2,2">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="auto" />
								<ColumnDefinition Width="*" />
							</Grid.ColumnDefinitions>
							<Grid.RowDefinitions>
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
							</Grid.RowDefinitions>
							
							<!-- DateTime -->
							<TextBlock Grid.Row="0"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}">
								DateTime
							</TextBlock>
							<custom:NullableDateTimePicker x:Name="dateTimeDateTimePicker"
														   Grid.Row="0"
														   Grid.Column="1" >
								<custom:NullableDateTimePicker.ToolTip>
									<custom:PowerToolTip Header="Date Time"
														 Error=""
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<TextBlock TextWrapping="WrapWithOverflow" >
												The date and time of image creation or last modification.
											</TextBlock>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</custom:NullableDateTimePicker.ToolTip>
							</custom:NullableDateTimePicker>
							
							<!-- DateTime Original -->
							<TextBlock Grid.Row="1"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}">
								DateTime Original
							</TextBlock>
							<custom:NullableDateTimePicker x:Name="dateTimeOriginalDateTimePicker"
														   Grid.Row="1"
														   Grid.Column="1" >
								<custom:NullableDateTimePicker.ToolTip>
									<custom:PowerToolTip Header="Date Time Original"
														 Error=""
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<TextBlock TextWrapping="WrapWithOverflow" >
												The date and time when the original image data was generated. For a DSC the date and time the picture was taken are recorded.
											</TextBlock>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</custom:NullableDateTimePicker.ToolTip>
							</custom:NullableDateTimePicker>
							
							<!-- DateTime Digitized -->
							<TextBlock Grid.Row="2"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}">
								DateTime Digitized
							</TextBlock>
							<custom:NullableDateTimePicker x:Name="dateTimeDigitizedDateTimePicker"
														   Grid.Row="2"
														   Grid.Column="1" >
								<custom:NullableDateTimePicker.ToolTip>
									<custom:PowerToolTip Header="Date Time Digitized"
														 Error=""
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<TextBlock TextWrapping="WrapWithOverflow" >
												The date and time the image was stored as digital
											</TextBlock>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</custom:NullableDateTimePicker.ToolTip>
							</custom:NullableDateTimePicker>
							
						</Grid>
					</Expander>

					<Expander x:Name="pictureConditionsExpander" 
						  Header="Picture Conditions"
						  BorderBrush="Blue"
						  BorderThickness="0,0,0,1" 
						  Background="LightBlue"
						  IsExpanded="{Binding ElementName=view, Path=IsPictureConditionsExpanded}">
						<Grid Background="White" 
						  Margin="2,3,2,2">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="auto" />
								<ColumnDefinition Width="*" />
							</Grid.ColumnDefinitions>
							<Grid.RowDefinitions>
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
								<RowDefinition Height="auto" />
							</Grid.RowDefinitions>
							
							<!-- Metering Mode -->
							<TextBlock Grid.Row="0"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}">
								Metering Mode
							</TextBlock>
							<ComboBox x:Name="meteringModeComboBox"
									  Grid.Row="0"
									  Grid.Column="1" >
								<ComboBox.ToolTip>
									<custom:PowerToolTip Header="Metering Mode"
														 Error=""
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<TextBlock TextWrapping="WrapWithOverflow" >
												The metering mode used for the image
											</TextBlock>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</ComboBox.ToolTip>
							</ComboBox>
							
							<!-- Exposure Time -->
							<TextBlock Grid.Row="1"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}">
								Exposure Time
							</TextBlock>
							<custom:RationalTextBox x:Name="exposureTimeTextBox"
													Grid.Row="1"
													Grid.Column="1"
													IsSigned="False"
													Style="{DynamicResource watermarkTextBox}" 
													Tag="{StaticResource watermarkString}"
													Validation.Error="exposureTimeTextBox_Error" >
								<custom:RationalTextBox.ToolTip>
									<custom:PowerToolTip Header="Exposure Time"
														 x:Name="exposureTimePowerToolTip"
														 Error=""
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<StackPanel>
												<TextBlock TextWrapping="WrapWithOverflow" >
													The exposure time, given in seconds (sec).
												</TextBlock>
												<TextBlock TextWrapping="WrapWithOverflow" >
													Valid Input: (NNN = integer)
												</TextBlock>
												<TextBlock TextWrapping="WrapWithOverflow" >
													NNN
												</TextBlock>
												<TextBlock TextWrapping="WrapWithOverflow" >
													NNN/NNN
												</TextBlock>
											</StackPanel>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</custom:RationalTextBox.ToolTip>
							</custom:RationalTextBox>
							
							<!-- Exposure Program -->
							<TextBlock Grid.Row="2"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}">
								Exposure Program
							</TextBlock>
							<ComboBox x:Name="exposureProgramComboBox"
									  Grid.Row="2"
									  Grid.Column="1" >
								<ComboBox.ToolTip>
									<custom:PowerToolTip Header="Exposure Program"
														 Error=""
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<TextBlock TextWrapping="WrapWithOverflow" >
												The class of the program used by the camera to set exposure when the image was taken.
											</TextBlock>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</ComboBox.ToolTip>
							</ComboBox>
							
							
							<!-- F Number -->
							<TextBlock Grid.Row="3"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}">
								F Number
							</TextBlock>
							<custom:RationalTextBox x:Name="fNumberTextBox"
													Grid.Row="3"
													Grid.Column="1"
													IsSigned="False"
													Style="{DynamicResource watermarkTextBox}" 
													Tag="{StaticResource watermarkString}"
													Validation.Error="fNumberTextBox_Error">
								<custom:RationalTextBox.ToolTip>
									<custom:PowerToolTip Header="F Number Text Box"
														 Error=""
														 x:Name="fNumberPowerToolTip"
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<StackPanel>
												<TextBlock TextWrapping="WrapWithOverflow" >
													The F Number used when the image was taken. 
												</TextBlock>
												<TextBlock TextWrapping="WrapWithOverflow" >
													Valid Input: (NNN = integer)
												</TextBlock>
												<TextBlock TextWrapping="WrapWithOverflow" >
													NNN 
												</TextBlock>
												<TextBlock TextWrapping="WrapWithOverflow" >
													NNN/NNN
												</TextBlock>
											</StackPanel>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</custom:RationalTextBox.ToolTip>
							</custom:RationalTextBox>
							
							<!-- ISO Speed Ratings -->
							<TextBlock Grid.Row="4"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}">
								ISO Speed Ratings
							</TextBlock>
							<custom:NumericTextBox x:Name="isoSpeedRatingsTextBox"
												   Grid.Row="4"
												   Grid.Column="1"
												   Style="{DynamicResource watermarkTextBox}"
												   Tag="{StaticResource watermarkString}"
												   IsSigned="False" >
								<custom:NumericTextBox.ToolTip>
									<custom:PowerToolTip Header="ISO Speed Ratings"
														 Error=""
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<TextBlock TextWrapping="WrapWithOverflow" >
												Indicates the ISO Speed and ISO Latitude of the camera or input device.
											</TextBlock>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</custom:NumericTextBox.ToolTip>
							</custom:NumericTextBox>
							
							<!-- Shutter Speed -->
							<TextBlock Grid.Row="5"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}">
								Shutter Speed
							</TextBlock>
							<custom:RationalTextBox x:Name="shutterSpeedTextBox"
													Grid.Row="5"
													Grid.Column="1"
													IsSigned="True"
													Style="{DynamicResource watermarkTextBox}" 
													Tag="{StaticResource watermarkString}"
													Validation.Error="shutterSpeedTextBox_Error">
								<custom:RationalTextBox.ToolTip>
									<custom:PowerToolTip Header="Shutter Speed"
														 Error=""
														 x:Name="shutterSpeedPowerToolTip"
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<StackPanel>
												<TextBlock TextWrapping="WrapWithOverflow" >
													The shutter speed of the camera when the image was generated. The unit is the APEX (Additive System of Photographic Exposure).
												</TextBlock>
												<TextBlock TextWrapping="WrapWithOverflow" >
													Valid Input: (NNN = integer)
												</TextBlock>
												<TextBlock TextWrapping="WrapWithOverflow" >
													NNN
												</TextBlock>
												<TextBlock TextWrapping="WrapWithOverflow" >
													-NNN
												</TextBlock>
												<TextBlock TextWrapping="WrapWithOverflow" >
													NNN/NNN
												</TextBlock>
												<TextBlock TextWrapping="WrapWithOverflow" >
													-NNN/NNN
												</TextBlock>
											</StackPanel>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</custom:RationalTextBox.ToolTip>
							</custom:RationalTextBox>
							
							<!-- Aperture -->
							<TextBlock Grid.Row="6"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}">
								Aperture
							</TextBlock>
							<custom:RationalTextBox x:Name="apertureTextBox"
													Grid.Row="6"
													Grid.Column="1"
													IsSigned="False"
													Style="{DynamicResource watermarkTextBox}" 
													Tag="{StaticResource watermarkString}"
													Validation.Error="apertureTextBox_Error">
								<custom:RationalTextBox.ToolTip>
									<custom:PowerToolTip Header="Aperture"
														 Error=""
														 x:Name="aperturePowerToolTip"
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<StackPanel>
												<TextBlock TextWrapping="WrapWithOverflow" >
													The aperture of the lens from the camera when this image was generated.
												</TextBlock>
												<TextBlock TextWrapping="WrapWithOverflow" >
													Valid Input: (NNN = integer)
												</TextBlock>
												<TextBlock TextWrapping="WrapWithOverflow" >
													NNN
												</TextBlock>
												<TextBlock TextWrapping="WrapWithOverflow" >
													NNN/NNN
												</TextBlock>
											</StackPanel>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</custom:RationalTextBox.ToolTip>
							</custom:RationalTextBox>
							
							<!-- Brightness -->
							<TextBlock Grid.Row="7"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}">
								Brightness
							</TextBlock>
							<custom:RationalTextBox x:Name="brightnessTextBox"
													Grid.Row="7"
													Grid.Column="1"
													IsSigned="True"
													Style="{DynamicResource watermarkTextBox}" 
													Tag="{StaticResource watermarkString}"
													Validation.Error="brightnessTextBox_Error">
								<custom:RationalTextBox.ToolTip>
									<custom:PowerToolTip Header="Brightness"
														 Error=""
														 x:Name="brightnessPowerToolTip"
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<StackPanel>
												<TextBlock TextWrapping="WrapWithOverflow" >
													The brightness of the camera when this image was generated
												</TextBlock>
												<TextBlock TextWrapping="WrapWithOverflow" >
													Valid Input: (NNN = integer)
												</TextBlock>
												<TextBlock TextWrapping="WrapWithOverflow" >
													NNN
												</TextBlock>
												<TextBlock TextWrapping="WrapWithOverflow" >
													-NNN
												</TextBlock>
												<TextBlock TextWrapping="WrapWithOverflow" >
													NNN/NNN
												</TextBlock>
												<TextBlock TextWrapping="WrapWithOverflow" >
													-NNN/NNN
												</TextBlock>
											</StackPanel>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</custom:RationalTextBox.ToolTip>
							</custom:RationalTextBox>
							
							<!-- Light Source -->
							<TextBlock Grid.Row="8"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}">
								Light Source
							</TextBlock>
							<ComboBox x:Name="lightSourceComboBox"
									  Grid.Row="8"
									  Grid.Column="1">
								<ComboBox.ToolTip>
									<custom:PowerToolTip Header="Light Source"
														 Error=""
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<TextBlock TextWrapping="WrapWithOverflow" >
												The light source the camera used when the image was generated.
											</TextBlock>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</ComboBox.ToolTip>
							</ComboBox>
							
							<!-- Sensing Method -->
							<TextBlock Grid.Row="9"
									   Grid.Column="0"
									   VerticalAlignment="{StaticResource labelVerticalAlignment}"
									   HorizontalAlignment="{StaticResource labelHorizontalAlignment}"
									   Width="{StaticResource labelWidth}">
								Sensing Method
							</TextBlock>
							<ComboBox x:Name="sensingMethodComboBox"
									  Grid.Row="9"
									  Grid.Column="1">
								<ComboBox.ToolTip>
									<custom:PowerToolTip Header="Sensing Method"
														 Error=""
														 MaxWidth="{StaticResource toolTipMaxWidth}">
										<custom:PowerToolTip.Description>
											<TextBlock TextWrapping="WrapWithOverflow" >
												Indicates the image sensor type on the camera or input device used to generate this image.
											</TextBlock>
										</custom:PowerToolTip.Description>
									</custom:PowerToolTip>
								</ComboBox.ToolTip>
							</ComboBox>
							
						</Grid>
					</Expander>
					
					
				</StackPanel>
			</ScrollViewer>
		</Border>
	</Grid>
</UserControl>
